{%- set mailon = salt['pillar.get']('default:OMV_CRONAPT_MAILON', 'upgrade') -%}
{%- set syslogon = salt['pillar.get']('default:OMV_CRONAPT_SYSLOGON', 'always') -%}
{%- set options = salt['pillar.get']('default:OMV_CRONAPT_OPTIONS', '') -%}
{{ pillar['headers']['multiline'] }}
# Configuration for cron-apt.
# The cron config is located in /etc/cron.d/cron-apt

# When to send email about the cron-apt results.
# Value: error   (send mail on error runs)
#        upgrade (when packages are upgraded)
#        changes (mail when change in output from an action)
#        output  (send mail when output is generated)
#        always  (always send mail)
#                (else never send mail)
{% if not notification_config.enable -%}
MAILON="never"
{%- else -%}
MAILON="{{ mailon }}"
{%- endif %}

# The email address to send mail to.
{% if not email_config.enable or not notification_config.enable -%}
#MAILTO=""
{%- else -%}
MAILTO="{{ email_config.primaryemail }}"
{%- endif %}

# Value: error   (syslog on error runs)
#        upgrade (when packages is upgraded)
#        changes (syslog when change in output from an action)
#        output  (syslog when output is generated)
#        always  (always syslog)
#                (else never syslog)
SYSLOGON="{{ syslogon }}"

# Value: verbose (log everything)
#        always  (always log)
#        upgrade (when packages is upgraded)
#        changes (log when change in output from an action)
#        output  (log when output is generated)
#        error   (log error runs only)
#                (else log nothing)
# DEBUG="output"

# General apt options that will be passed to all APTCOMMAND calls.
# Use "-o quiet" instead of "-q" for aptitude compatibility.
#  OPTIONS="-o quiet=1"
# You can for example add an additional sources.list file here.
#  OPTIONS="-o quiet=1 -o Dir::Etc::SourceList=/etc/apt/security.sources.list"
# You can also set an alternative sources.list file here.
#  OPTIONS="-o quiet=1 -o Dir::Etc::SourceList=/etc/apt/security.sources.list -o Dir::Etc::SourceParts=\"/dev/null\""
# If you want to allow unauthenticated and untrusted packages add the
# following to your options directive.
#  OPTIONS="-o quiet=1 -o APT::Get::AllowUnauthenticated=true -o aptitude::Cmdline::ignore-trust-violations=yes"
# To limit the bandwidth used use the following line. This example limit the
# bandwidth usage to 25 kB/s.
#  OPTIONS="-o Acquire::http::Dl-Limit=25"
OPTIONS="{{ options }}"
